import { fetchConfig } from "@/api/common";

export default {
    // MapServerUrl: "http://220.171.54.19:6080/arcgis/rest/services/ZHGW/ZT_Tile_ZWWW_Blue_Label/MapServer/",
    mapServerUrl: async () => {
        const config = await fetchConfig();
        return config.MAP_SERVER_URL;
    },
    MAP_MARKER_ICON: {
        // 事件图标
        EVENT: "map_event_marker_icon.png",
        // 摄像头图标
        CAMERA: "map_camera_marker_icon.png",
        // 车辆图标
        CAR: "map_car_marker_icon.png",
        // 人员
        PERSON: "map_user_marker_icon.png",
        // 资源
        RESOURCE: "map_resource_marker_icon.png",
    },
    mapResUrl: async () => {
        const config = await fetchConfig();
        return config.MAP_RESOURCE_URL + "/assets/map_statics/";
    },
    mapOptions: async () => {
        const config = await fetchConfig();
        return {
            url: config.MAP_RESOURCE_URL + "/arcgis_js_api/javascript/4.22/init.js",
            css: config.MAP_RESOURCE_URL + "/arcgis_js_api/javascript/4.22/esri/themes/light/main.css",
        };
    },
};
